<?php

/**
 * 导入类
 */
use EasyWeChat\Factory;

/**
 * 微信公众号OAuth2.0授权类
 */
class WechatOfficialAuth {
    protected $app = null;

    public function __construct() {
        $config = [
            "app_id" => WECHAT_H5['appid'],
            "secret" => WECHAT_H5['secret'],
            "token" => '',
            "response_type" => 'array',
            "oauth" => [
                'scopes' => ['snsapi_userinfo'],
                "callback" => "pages/logout.php"
            ]
        ];
        $this->app = Factory::officialAccount($config);
    }
    
    public function auth(){
        $oauth = $this->app->oauth;
        return $oauth;
    }

    public function userInfo(){

    }
}
